///@file Complex.h
///@brief Declaration of the class representing a complex number
///@author Arnaud Duval
///@version 0.0
///@date 2009/11/03


#ifndef COMPLEX_H
#define COMPLEX_H

#include <cassert>
#include <iostream>

///@class Complex
///@brief Class defining a complex number
///@warning This class need to be tested
/// A complex number is made of a real part and an imaginary part
class Complex
{
	private:
		///@brief real part
		double real;
		///@brief imaginary part
		double imaginary;
	public:
		///@brief Default constructor
		Complex();
		///@brief Constructor with argument
		Complex(double, double);
		///@brief Copy constructor
		Complex(const Complex &);
		///@brief Copy constructor for temporary object
		Complex(Complex*);
		///@brief Destructor
		~Complex();
		///@brief Overload of = operator
		Complex& operator=(const Complex &);
		///@brief Overload of = operator for temporary object
		Complex& operator=(Complex*);
		///@brief Overload of [] operator, access to real or imaginary part
		double& operator[](unsigned int);	
		///@brief Overload of += operator
		void operator += (const Complex&);
		///@brief Overload of -= operator
		void operator -= (const Complex&);
		///@brief Compute argument
		double Argument();
		///@brief Compute norm
		double Norm();
		///@brief Compute conjugate complex number
		Complex Conjugate();


		///@brief Overload of + operator
		friend Complex operator + (const Complex&, const Complex&);
		///@brief Overload of - operator	
		friend Complex operator - (const Complex&, const Complex&);
		///@brief Overload of * operator : product complex-real
		friend Complex operator * (const Complex&, const double&);
		///@brief Overload of * operator : product real-complex
		friend Complex operator * (const double&, const Complex&);
		///@brief Overload of * operator : product complex-complex
		friend Complex operator * (const Complex&, const Complex&);
		///@brief Overload of / operator : division of a complex by a real
		friend Complex operator / (const Complex& , const double&);
		///@brief Overload of / operator : division of a real by a complex
		friend Complex operator / (const double&, const Complex&);
		///@brief Overload of / operator : division of a complex by a comples
		friend Complex operator / (const Complex&, const Complex&);
		///@brief Overload of << operator
		friend std::ostream& operator<<(std::ostream &, const Complex&);

};

#endif